<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!-- 引入 elementUI 样式 -->
    <link rel="stylesheet" href="./element-ui-2.13.0/lib/theme-chalk/index.css">
    <!-- 引入 vue 的js文件： elementUI基于Vue开发，必须在elementUI的js文件之前引入 -->
    <script src="js/vue-v2.6.10.js"></script>
    <!-- 引入elementUI 组件库 -->
    <script src="./element-ui-2.13.0/lib/index.js"></script>
    <style type="text/css">
        .el-dropdown-link {
            cursor: pointer;
            color: #409EFF;
        }
        .el-icon-arrow-down {
            font-size: 12px;
        }
    </style>
</head>
<body>
<div id="app">
    <!--@command="handleCommand" 点击菜单项触发的事件回调  -->
    <el-dropdown @command="handleCommand">
    <span class="el-dropdown-link">
         下拉菜单<i class="el-icon-arrow-down el-icon--right"></i>
    </span>
        <el-dropdown-menu slot="dropdown">
            <!--command : 选项对应的指令-->
            <el-dropdown-item command="a">黄金糕</el-dropdown-item>
            <el-dropdown-item command="b">狮子头</el-dropdown-item>
            <el-dropdown-item command="c">螺蛳粉</el-dropdown-item>
            <el-dropdown-item command="d" disabled>双皮奶</el-dropdown-item>
            <el-dropdown-item command="e" divided>蚵仔煎</el-dropdown-item>
        </el-dropdown-menu>
    </el-dropdown>
</div>
</body>
<script type="text/javascript">
    new Vue({
        el: "#app",
        methods: {
            // 回调函数  command ： 对应选项的指令
            handleCommand(command) {
                this.$message('click on item ' + command);
            }
        }
    });
</script>
</html>